home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / examples / exam08 / main.c < prev    next >
C/C++ Source or Header  |  1995-09-27  |  1KB  |  91 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24. #include "generics.h"
  25.  
  26.  
  27. main(int argc, char *argv[])
  28. {
  29.     object    obj;
  30.  
  31.     InitDynace(&argc);
  32.  
  33.  
  34.     /*  Create and print an instance of short integer  */
  35.  
  36.     obj = gNewWithInt(ShortInteger, 8);
  37.     gPrint(obj, stdoutStream);
  38.  
  39.  
  40.     /*  Cause an error by trying to execute a generic which is not
  41.         associated with the ShortInteger class  (comment out the
  42.         next line after running the program to allow the following
  43.         errors to be demonstrated).  */
  44.  
  45.     gFirst(obj);
  46.  
  47.  
  48.     /*  Create another error condition where there is a missing second
  49.         argument (uncomment out the next line to demo the error -
  50.         re-comment to see the following error) */
  51.  
  52. /*    gPrint(obj);    */
  53.  
  54.  
  55.  
  56.     /*  Cause an error by attempting to use an object after it has
  57.         been disposed.  */
  58.  
  59.     gDispose(obj);
  60.     gPrint(obj, stdoutStream);
  61.  
  62.     
  63.  
  64.     return 0;
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. /*
  74.  *
  75.  *    This source code is CONFIDENTIAL and
  76.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  77.  *    distribution, adaptation or use    may
  78.  *    be subject to civil and    criminal penalties.
  79.  *
  80.  *    Copyright (c) 1993 Algorithms Corporation
  81.  *    3020 Liberty Hills Drive
  82.  *    Franklin, TN  37064
  83.  *
  84.  *    ALL RIGHTS RESERVED.
  85.  *
  86.  *
  87.  *
  88.  */
  89.  
  90.  
  91.